package com.mas.admin.biz.dal.mysql.permission;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mas.admin.biz.dal.dataobject.permission.RoleMenuDO;
import com.mas.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;

/**
 * @author godyao
 * @description RoleMenuMapper
 * @date 2023年02月01日21:19
 */
@Mapper
public interface RoleMenuMapper extends BaseMapperX<RoleMenuDO> {
    //@Select("SELECT COUNT(*) FROM system_role_menu WHERE update_time > #{maxUpdateTime}")
    //Long selectCountByUpdateTimeGt(LocalDateTime maxUpdateTime);
    default Long selectCountByUpdateTimeGt(LocalDateTime maxUpdateTime) {
        return selectCount(new LambdaQueryWrapper<RoleMenuDO>().gt(RoleMenuDO::getUpdateTime, maxUpdateTime));
    }
}
